<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ghost Floating</title>
    <link rel="shortcut icon" href="../兰/youling0.png" type="image/x-icon">
    <style>
        * {
            padding: 0;
            text-decoration: none;
            list-style: none;

        }

        body {
            padding: 20px;
            background-color: aliceblue;

        }

        #all {
            position: relative;
            margin: auto;
            width: 60%;
        }

        /* 定义一个框架 */
        #banner {
            width: 800px;
            height: 400px;
            border: 2px solid gray;
            overflow: hidden;
            position: absolute;
            background: url('./img/背景.png') repeat;
            animation: moveBackground 20s linear infinite;

        }

        /* 背景移动 */
        @keyframes moveBackground {
            0% {
                background-position: 0 0;
            }

            100% {
                background-position: -1000px 0px;
            }
        }

        /* 角色受伤效果 */
        @keyframes hurt {

            to {
                opacity: 0%;
            }

        }

        #game {
            width: 800px;
            height: 300px;
            position: absolute;
        }

        /* dino人物 */
        #dino {
            width: 100px;
            height: 130px;
            position: absolute;
            bottom: 40px;
            left: 50px;
        }

        .standing {
            /* 通过transform属性来调整高度 */
            transform: translateY(0);
            transition: transform 0.3s ease;
            /* 平滑过渡效果 */
        }

        .crouching {
            /* 下时降低鬼的高度 */
            transform: translateY(105px);
        }

        .up {
            /* 上滑高度 */
            transform: translateY(-105px);
        }

        /* 障碍物定义 */
        .obstacle {
            position: absolute;
            width: 50px;
            height: 50px;
        }

        /* 生命值定义 */
        .health>ul {
            position: absolute;
            display: flex;
            flex-direction: row;
        }

        /* 死亡界面 */
        #banner>#die {
            z-index: 9;
            width: 100%;
            height: 100%;
            position: absolute;
            overflow: hidden;

        }

        #banner>#die>img {
            width: 100%;
            height: 100%;
            position: absolute;
            top: -100%;
            transition: all 0.5s ease;
        }

        .choice {
            font-size: 40px;
            color: rgb(144, 15, 15);
            position: absolute;
            display: none;
            left: 40%;
            cursor: pointer;
        }

        .choice0 {
            font-size: 25px;
            color: aqua;
            position: absolute;
            margin: 0px;
            left: 33%;         
            top: 0%
        }

        .choice1 {
            top: 5%;
            left:30% ;           
            font-style: italic;
            font-size: 45px;
        }

        .choice2 {
            top: 32%;
            left: 44%;
        }

        .choice3 {
            top: 58%;
            left: 33%;

        }
        #stop{
            font-weight: bolder;
            font-size: 20px;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background-color: rgb(247, 236, 236);
            color: rgb(133, 80, 145);
            cursor: pointer;
            position:absolute;
            right: 10px;
            top: 10px;
            z-index: 99;
                    }
        #btnstop {
            width: 100%;
            height: 100%;
            position: absolute;
            display: none;
            cursor: pointer;
            background: #00000037;
        }
        #btnstop>p{
            background:linear-gradient(to right, hsl(201, 29%, 86%), hsl(264, 24%, 77%));
            font-size: 30px;
            border-radius: 10px;
            padding: 10px;
            color: rgb(108, 11, 92);
            position: absolute;
            /* display: none; */
            left: 40%;
            cursor: pointer;
            text-align: center;
            z-index: 50;
        }
        #btnstop>p:hover{
            box-shadow: 5px 5px 5px #00000037;
            font-size: 31px;
            opacity: 95%;
        }

       

        .continue{
            top: 5%;
            
        }

        .re{
            top: 32%;
            
        }

        .start{
            top: 58%;
            

        }
    </style>
</head>

<body>
    
    <div id="all">
        <!-- banner框架，dino为玩家，health为生命值 -->
        <div id="banner">

            <div id="game">
                <div id="dino">
                    <img style="width: 80px; height: 100px;" src="./img/鬼.gif" alt="Player Dino">
                </div>               
                    </div>

            <!-- 暂停 -->
                <div>
                    <button id="stop" onclick="stopgame()">||</button>                    
                    <div id="btnstop">             
                        <p class="continue"  onclick="gameLoop()">继续游戏</p>
                        <p class="re"  onclick="again()">重玩游戏</p>
                        <p class="start" href="" onclick="start()">退出游戏</p>
                    </div>
            </div>
            <!-- 暂停end -->
            <div id="die"> <img src="xiao/死亡界面.png" alt="">
                <p class="choice0"></p>
                <p class="choice choice1">很遗憾，你死了~</p>
                <p class="choice choice2">重玩</p>
                <p class="choice choice3" href="">返回开始界面</p>
            </div>
            
        </div>

        <div class="health">
            <ul>
                <li healthy1><img style="width: 40px; height: 40px;" src="./img/生命值（爱心）.png" alt=""></li>
                <li healthy2><img style="width: 40px; height: 40px;" src="./img/生命值（爱心）.png" alt=""></li>
                <li healthy3><img style="width: 40px; height: 40px;" src="./img/生命值（爱心）.png" alt=""></li>
            </ul>
        </div>

    </div>

</body>

<script src="./move.js"></script>
<script src="./block.js"></script>
<script src="./audio.js"></script>
<script src="./结算界面.js"></script>

</html>